package com.primeton.wh.mcenter.api.model;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.Date;

/**
 * <p>
 * 消息表
 * </p>
 *
 * @author YunTao.Li
 * @since 2020-03-15
 */
@TableName("sys_message")
public class Message extends Model<Message> {

    private static final long serialVersionUID = 1L;
    // 原先是ASSIGN_ID
    @TableId(type = IdType.ASSIGN_ID, value = "MC_ID")
    private String mcId;

    /**
     * 消息标题
     */
    @TableField("MC_TITLE")
    @NotNull(message = "title cannot be null")
    private String mcTitle;

    /**
     * 消息内容
     */
    @TableField("MC_CONTENT")
    @NotNull(message = "content cannot be null")
    private String mcContent;

    /**
     * 消息内容带格式(站内信专用)
     */
    @TableField("MC_CONTENT_HTML")
    private String mcContentHtml;

    /**
     * 消息目录ID
     */
    @TableField("MC_CATEFORY_ID")
    private String mcCateforyId;

    /**
     * 1短信；2邮件；3站内信
     */
    @TableField("MC_TYPE")
    @NotNull(message = "type cannot be null")
    private String mcType;

    /**
     * 通知级别1级最高
     */
    @TableField("MC_LEAVE")
    private Integer mcLeave;

    /**
     * 状态：0未推送，1已推送，2已阅读，3已作废
     */
    @TableField("MC_STATUS")
    private Integer mcStatus;

    /**
     * 通知创建时间
     */
    @TableField("MC_CREATETIME")
    private Date mcCreatetime;

    @TableField("MC_APP_CODE")
    private String mcAppCode;

    /**
     * 通知推送时间
     */
    @TableField("MC_SENDTIME")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") //Jackson包使用注解
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") //格式化前台日期参数注解
    private Date mcSendtime;

    public Date getMcEffecttime() {
        return mcEffecttime;
    }

    public void setMcEffecttime(Date mcEffecttime) {
        this.mcEffecttime = mcEffecttime;
    }

    /**
     * 延迟时间
     */
    @TableField("MC_EFFECTIVETIME")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") //Jackson包使用注解
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") //格式化前台日期参数注解
    private Date mcEffecttime;

    /**
     * 通知推送次数
     */
    @TableField("MC_SEND_TIMES")
    private Integer mcSendTimes;

    /**
     * 发送方所属系统code
     */
    @TableField("MC_FROM_SYS_CODE")
    private String mcFromSysCode;

    /**
     * 发送方所属机构code
     */
    @TableField("MC_FROM_ORG_CODE")
    private String mcFromOrgCode;

    /**
     * 发送方所属部门code
     */
    @TableField("MC_FROM_DEPT_CODE")
    private String mcFromDeptCode;

    /**
     * 发送人empcode|邮件|电话
     */
    @TableField("MC_FROM")
    @NotNull(message = "type cannot be null")
    private String mcFrom;

    /**
     * 发送人姓名
     */
    @TableField("MC_FROM_EMP_NAME")
    private String mcFromEmpName;

    /**
     * 收件方所属系统code
     */
    @TableField("MC_TO_SYS_CODE")
    private String mcToSysCode;

    /**
     * 收件方所属机构code
     */
    @TableField("MC_TO_ORG_CODE")
    private String mcToOrgCode;

    /**
     * 收件方所属部门code
     */
    @TableField("MC_TO_DEPT_CODE")
    private String mcToDeptCode;

    /**
     * 收件人empcode|邮件|电话
     */
    @TableField("MC_TO")
    @NotNull(message = "type cannot be null")
    private String mcTo;

    /**
     * 收件人姓名
     */
    @TableField("MC_TO_EMP_NAME")
    private String mcToEmpName;

    /**
     * 批次号
     */
    @TableField("MC_BATCH_ID")
    private String mcBatchId;


    public String getMcId() {
        return mcId;
    }

    public Message setMcId(String mcId) {
        this.mcId = mcId;
        return this;
    }

    public String getMcTitle() {
        return mcTitle;
    }

    public Message setMcTitle(String mcTitle) {
        this.mcTitle = mcTitle;
        return this;
    }

    public String getMcContent() {
        return mcContent;
    }

    public Message setMcContent(String mcContent) {
        this.mcContent = mcContent;
        return this;
    }

    public String getMcContentHtml() {
        return mcContentHtml;
    }

    public Message setMcContentHtml(String mcContentHtml) {
        this.mcContentHtml = mcContentHtml;
        return this;
    }

    public String getMcCateforyId() {
        return mcCateforyId;
    }

    public Message setMcCateforyId(String mcCateforyId) {
        this.mcCateforyId = mcCateforyId;
        return this;
    }

    public String getMcType() {
        return mcType;
    }

    public Message setMcType(String mcType) {
        this.mcType = mcType;
        return this;
    }

    public Integer getMcLeave() {
        return mcLeave;
    }

    public Message setMcLeave(Integer mcLeave) {
        this.mcLeave = mcLeave;
        return this;
    }

    public Integer getMcStatus() {
        return mcStatus;
    }

    public Message setMcStatus(Integer mcStatus) {
        this.mcStatus = mcStatus;
        return this;
    }

    public Date getMcCreatetime() {
        return mcCreatetime;
    }

    public Message setMcCreatetime(Date mcCreatetime) {
        this.mcCreatetime = mcCreatetime;
        return this;
    }

    public Date getMcSendtime() {
        return mcSendtime;
    }

    public Message setMcSendtime(Date mcSendtime) {
        this.mcSendtime = mcSendtime;
        return this;
    }

    public Integer getMcSendTimes() {
        return mcSendTimes;
    }

    public Message setMcSendTimes(Integer mcSendTimes) {
        this.mcSendTimes = mcSendTimes;
        return this;
    }

    public String getMcFromSysCode() {
        return mcFromSysCode;
    }

    public Message setMcFromSysCode(String mcFromSysCode) {
        this.mcFromSysCode = mcFromSysCode;
        return this;
    }

    public String getMcFromOrgCode() {
        return mcFromOrgCode;
    }

    public Message setMcFromOrgCode(String mcFromOrgCode) {
        this.mcFromOrgCode = mcFromOrgCode;
        return this;
    }

    public String getMcFromDeptCode() {
        return mcFromDeptCode;
    }

    public Message setMcFromDeptCode(String mcFromDeptCode) {
        this.mcFromDeptCode = mcFromDeptCode;
        return this;
    }

    public String getMcFrom() {
        return mcFrom;
    }

    public Message setMcFrom(String mcFrom) {
        this.mcFrom = mcFrom;
        return this;
    }

    public String getMcFromEmpName() {
        return mcFromEmpName;
    }

    public Message setMcFromEmpName(String mcFromEmpName) {
        this.mcFromEmpName = mcFromEmpName;
        return this;
    }

    public String getMcToSysCode() {
        return mcToSysCode;
    }

    public Message setMcToSysCode(String mcToSysCode) {
        this.mcToSysCode = mcToSysCode;
        return this;
    }

    public String getMcToOrgCode() {
        return mcToOrgCode;
    }

    public Message setMcToOrgCode(String mcToOrgCode) {
        this.mcToOrgCode = mcToOrgCode;
        return this;
    }

    public String getMcToDeptCode() {
        return mcToDeptCode;
    }

    public Message setMcToDeptCode(String mcToDeptCode) {
        this.mcToDeptCode = mcToDeptCode;
        return this;
    }

    public String getMcTo() {
        return mcTo;
    }

    public Message setMcTo(String mcTo) {
        this.mcTo = mcTo;
        return this;
    }

    public String getMcToEmpName() {
        return mcToEmpName;
    }

    public Message setMcToEmpName(String mcToEmpName) {
        this.mcToEmpName = mcToEmpName;
        return this;
    }

    public String getMcBatchId() {
        return mcBatchId;
    }

    public Message setMcBatchId(String mcBatchId) {
        this.mcBatchId = mcBatchId;
        return this;
    }

    @Override
    protected Serializable pkVal() {
        return this.mcId;
    }

    @Override
    public String toString() {
        return "Message{" +
                "mcId=" + mcId +
                ", mcTitle=" + mcTitle +
                ", mcContent=" + mcContent +
                ", mcContentHtml=" + mcContentHtml +
                ", mcCateforyId=" + mcCateforyId +
                ", mcType=" + mcType +
                ", mcLeave=" + mcLeave +
                ", mcStatus=" + mcStatus +
                ", mcCreatetime=" + mcCreatetime +
                ", mcSendtime=" + mcSendtime +
                ", mcSendTimes=" + mcSendTimes +
                ", mcFromSysCode=" + mcFromSysCode +
                ", mcFromOrgCode=" + mcFromOrgCode +
                ", mcFromDeptCode=" + mcFromDeptCode +
                ", mcFrom=" + mcFrom +
                ", mcFromEmpName=" + mcFromEmpName +
                ", mcToSysCode=" + mcToSysCode +
                ", mcToOrgCode=" + mcToOrgCode +
                ", mcToDeptCode=" + mcToDeptCode +
                ", mcTo=" + mcTo +
                ", mcToEmpName=" + mcToEmpName +
                ", mcBatchId=" + mcBatchId +
                "}";
    }

    public String getMcAppCode() {
        return mcAppCode;
    }

    public void setMcAppCode(String mcAppCode) {
        this.mcAppCode = mcAppCode;
    }
}
